package com.jstorm.count.mapper.signal;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: common
 * @Package: com.jstorm.count.mapper.network
 * @ClassName: NetworkMapper
 * @Description:
 * @Author: Mr_hu
 * @CreateDate: 2018/12/28 18:34
 * ***********************************************************
 * @UpdateUser: Mr_hu
 * @UpdateDate: 2018/12/28 18:34
 * @UpdateRemark: The modified content
 * @Version: 1.0
 * ***********************************************************
 * Copyright: Copyright (c) 2018
 **/
@Mapper
public interface SignalMapper {

    /**
     * 查询数量
     * @return
     */
 @Select( "select * from (select  table_name as metadataName  ,num_rows as metadataCount from all_tables \n" +
         " WHERE  table_name LIKE  '%T_WB%' ORDer by num_rows desc)\n" +
         " where  metadataName='T_WB_NO7SIGLIN'or metadataName='T_WB_NO7TELSERMSSPAR'")
    List<Map<String, Object>>  selectSignalCount();

    /**
     * 查询总数
     * @return
     */
    @Select("select sum(metadataCount) as Total_count,'ATM信令采集处理服务' as Total_name from (select  table_name as metadataName  ," +
            "num_rows as metadataCount from all_tables \n" +
            "       WHERE  table_name LIKE  '%T_WB%' ORDer by num_rows desc)\n" +
            "       where  metadataName='T_WB_NO7SIGLIN'or metadataName='T_WB_NO7TELSERMSSPAR'")
    List<Map<String, Object>>   selectSignalTotal();

}
